package com.niodata.dp.collection;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class WrappedStringMap extends HashMap<String, String> implements Serializable {

  public WrappedStringMap() {
  }

  public WrappedStringMap(Map<String, String> map) {
    super.putAll(map);
  }

  public String getString(String key) {
    return super.containsKey(key) ? super.get(key) : null;
  }

  public String getString(String key, String defaultValue) {
    return super.containsKey(key) ? super.get(key) : defaultValue;
  }

  public Integer getInteger(String key, Integer defaultValue) {
    return super.containsKey(key) ? Integer.valueOf(super.get(key)) : defaultValue;
  }

  public Integer getInteger(String key) {
    return super.containsKey(key) ? Integer.valueOf(super.get(key)) : null;
  }

  public Boolean getBoolean(String key, Boolean defaultValue) {
    return super.containsKey(key) ? Boolean.valueOf(super.get(key)) : defaultValue;
  }

  public Boolean getBoolean(String key) {
    return super.containsKey(key) ? Boolean.valueOf(super.get(key)) : null;
  }


  public Long getLong(String key, Long defaultValue) {
    return super.containsKey(key) ? Long.valueOf(super.get(key)) : defaultValue;
  }

  public Long getLong(String key) {
    return super.containsKey(key) ? Long.valueOf(super.get(key)) : null;
  }

  public Float getFloat(String key, Float defaultValue) {
    return super.containsKey(key) ? Float.valueOf(super.get(key)) : defaultValue;
  }

  public Float getFloat(String key) {
    return super.containsKey(key) ? Float.valueOf(super.get(key)) : null;
  }

  public Double getDouble(String key, Double defaultValue) {
    return super.containsKey(key) ? Double.valueOf(super.get(key)) : defaultValue;
  }

  public Double getDouble(String key) {
    return super.containsKey(key) ? Double.valueOf(super.get(key)) : null;
  }
}
